home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriter--Chooser snooper / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1995-04-10  |  6.5 KB  |  251 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r -    other resources needed in order for driver to work
  3.                         with the Chooser.
  4.     
  5.     Copyright © 1992-1994 Apple Computer, Inc.
  6.     All rights reserved.
  7.  
  8.      8/26/94        dmh                Updated to 1.0.1 driver sources for SDK.
  9.      3/22/94        dmh                Updated for the b4 seed.
  10.     12/20/93        dmh                Sync'd with the shipping 1.0b3 GX driver.
  11. */
  12.  
  13. #include "Types.r"
  14. #include "SysTypes.r"
  15. #include "PrintingResTypes.r"
  16.  
  17. //--------------------------------------------------------------------------------------------
  18. // THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  19. //--------------------------------------------------------------------------------------------
  20.  
  21. // what type of communication does this device use (this is the default, as the actual
  22. // value can be found in the desktop printer).
  23. resource 'look' (-4096, sysheap, purgeable) {
  24.     2,                // use the second in our list by default
  25.     
  26.     {
  27.     "AppleTalk",    -4096,        isAppleTalk,                "ImageWriter";
  28.     "Serial",        -4095,        iconCells,                    "Modem Port";
  29.     "Servers",        -4094,        isAppleTalk+isPrinterShare,    "ImageWriterIIIS";
  30.     };
  31. };
  32.  
  33.  
  34. resource 'comm' (-4096, sysheap, purgeable) {
  35.     PAP
  36.         {
  37.         1,
  38.         "",
  39.         0, 0, 0, 0
  40.         };
  41. };
  42.  
  43. resource 'comm' (-4095, sysheap, purgeable) {
  44.     Serial
  45.         {
  46.         baud9600,        /* Output baud rate */
  47.         noParity,        /* Output parity */
  48.         twoStop,        /* Output stop bits */
  49.         data8,            /* Output data size */
  50.         0xFFFF1113,        /* Output handshaking */
  51.         0x00000000,
  52.         baud9600,        /* Input baud rate */
  53.         noParity,        /* Input parity */
  54.         twoStop,        /* Input stop bits */
  55.         data8,            /* Input data bits */
  56.         0xFFFF1113,        /* Input handshaking */
  57.         0x00000000,
  58.         1024,            /* Input buffer size */
  59.         ".AIn",            /* Input driver name */
  60.         ".AOut"            /* Output driver name */
  61.         };
  62. };
  63.  
  64. resource 'comm' (-4094, sysheap, purgeable) {
  65.     PrinterShare
  66.         {
  67.         "",
  68.         0
  69.         };
  70. };
  71.  
  72.     
  73.  
  74. //--------------------------------------------------------------------------------------------
  75. // STANDARD CHOOSER PACK STUFF
  76. //--------------------------------------------------------------------------------------------
  77.  
  78. // NBP Lookup type (maxed out so resource file won't need updating)
  79. resource 'STR ' (-4096, sysheap, purgeable)
  80. {
  81.     "XXXXXXXXXXXXXXXXXXXXXX";
  82. };
  83.  
  84. // NBP timeout value
  85. type 'GNRL'
  86. {
  87.     byte;    // timeout
  88.     byte;    // retries
  89. };
  90.  
  91. resource 'GNRL' (-4096, sysheap, purgeable)
  92. {
  93.     11,
  94.     5
  95. };
  96.  
  97. // title string (we'll put a control here, so we don't want a title)
  98. resource 'STR ' (-4091, sysheap, purgeable)
  99. {
  100.     "";
  101. };
  102.  
  103. // "left" button title
  104. resource 'STR ' (-4093, sysheap, purgeable)
  105. {
  106.     "Create";
  107. };
  108.  
  109. // rectangle list
  110. resource 'nrct' (-4096, sysheap, purgeable) {
  111.     {
  112.     {112, 251, 132, 311};            // left button
  113.     {0,0,0,0};                        // right button
  114.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  115.     {0,0,0,0};                        // off button
  116.     {0,0,0,0};                        // button label
  117.     };
  118. };
  119.  
  120. // Menu used to select between direct connect, AppleTalk, and Servers
  121. resource 'MENU' (-4096, sysheap, purgeable)
  122. {
  123.     -4096,
  124.     textMenuProc,
  125.     0xFFFFFFFF,    
  126.     enabled,
  127.     "",
  128.     {
  129.     }
  130. };
  131.  
  132. // Pop-up control used to select between direct connect printers and those being shared on the network
  133. resource 'CNTL' (-4096, sysheap, purgeable)
  134. {
  135.     {0, 0, 20, 213},                            // zero based control location
  136.     0,                                            // Title options 0 = Left justified
  137.     visible,                                    // Should we display the control?
  138.     95,                                            // Title Width
  139.     -4096,                                        // 'MENU' to display
  140.     popupMenuCDEFproc+popupFixedWidth,            // CDEF = CDEFID * 16 + varCode
  141.     0,                                             // refCon = ResType to append = None
  142.     "Connect via:"                                // Control title
  143. };
  144.  
  145. resource 'DITL' (-4096, sysheap, purgeable) 
  146. {
  147.     {
  148.         {3, 238, 23, 238 + 213}, 
  149.             Control {enabled, -4096},
  150.     };
  151. };
  152.  
  153. resource 'DITL' (-4095, sysheap, purgeable) {
  154.     {    /* array DITLarray: 2 elements */
  155.         /* [1] */
  156.         {143, 310, 163, 368},
  157.         Button {
  158.             enabled,
  159.             "OK"
  160.         },
  161.         /* [2] */
  162.         {23, 87, 119, 377},
  163.         StaticText {
  164.             disabled,
  165.             "This printer driver could not be used.\n\n"
  166.             "Quitting one or more applications and then "
  167.             "trying again may allow you to use this "
  168.             "printer driver."
  169.         }
  170.     }
  171. };
  172.  
  173. resource 'ALRT' (-4095, sysheap, purgeable) {
  174.     {30, 30, 30+175, 30+380},
  175.     -4095,
  176.     {    /* array: 4 elements */
  177.         /* [1] */
  178.         OK, visible, sound1,
  179.         /* [2] */
  180.         OK, visible, sound1,
  181.         /* [3] */
  182.         OK, visible, sound1,
  183.         /* [4] */
  184.         OK, visible, sound1
  185.     },
  186.     alertPositionParentWindowScreen
  187. };
  188.  
  189. //-----------------------------------------------------------------------------------
  190. // CHOOSER PACK HELP RESOURCES
  191. //-----------------------------------------------------------------------------------
  192.  
  193.  
  194. /*    Any Chooser package can get balloons on all items that are normally 
  195.     added to the Chooser dialog by containing a STR# resource of 
  196.     resource ID = PackResID (-5694) and following the convention below:
  197.         
  198.         resource 'STR#' (-5694, sysheap, purgeable) {
  199.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  200.                 "kDisabledLeftButton";    // message for the control that is Disabled
  201.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  202.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  203.                 "kEnabledRightButton";
  204.                 "kDisabledRightButton";
  205.                 "kCheckedRightButton";
  206.                 "kOtherRightButton";
  207.                 "kEnabledOnButton";
  208.                 "kDisabledOnButton";
  209.                 "kCheckedOnButton";
  210.                 "kOtherOnButton";
  211.                 "kEnabledOffButton";
  212.                 "kDisabledOffButton";
  213.                 "kCheckedOffButton";
  214.                 "kOtherOffButton";
  215.                 "kEnabledOnOffTitle";
  216.                 "kDisabledOnOffTitle";
  217.                 "kCheckedOnOffTitle";
  218.                 "kOtherOnOffTitle";
  219.           }
  220.         };
  221.         
  222.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  223. */
  224.  
  225. resource 'STR#' (-5694, sysheap, purgeable) {
  226.   {        
  227.   
  228.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  229.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  230.         "";    // message for the control that is Checked (ie CtrlValue>0)
  231.         "";    // message for the control that is Other (ie CtrlValue>1)
  232.         "";    // kEnabledRightButton
  233.         "";    // kDisabledRightButton
  234.         "";    // kCheckedRightButton
  235.         "";    // kOtherRightButton
  236.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  237.         "";    // kDisabledOnButton
  238.         "";    // kCheckedOnButton 
  239.         "";    // kOtherOnButton
  240.         "";    // kEnabledOffButton
  241.         "";    // kDisabledOffButton
  242.         "";    // kCheckedOffButton
  243.         "";    // kOtherOffButton
  244.         "";    // kEnabledOnOffTitle
  245.         "";    // kDisabledOnOffTitle
  246.         "";    // kCheckedOnOffTitle
  247.         "";    // kOtherOnOffTitle
  248.   }
  249. };
  250.  
  251.